]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
polkitAgent: Return GLib.SOURCE_REMOVE on timeout callback
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Fri, 17 Apr 2020 15:51:27 +0000 (17:51 +0200)
committerMarco Trevisan <mail@3v1n0.net>
Fri, 17 Apr 2020 16:17:51 +0000 (16:17 +0000)
resetDialog is used (also) as GLib timeout function, so while just returning
an undefined value will stop the timeout anyways, it's just cleaner to
use the GSource expected return values

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1203

js/ui/components/polkitAgent.js

index 4bfbde1bb0ed60b98d6a5d5e93780cbd1c4cea7a..d77f797c0c0912f8090faff30a75fe3a848a4c15 100644 (file)
@@ -328,11 +328,13 @@ var AuthenticationDialog = GObject.registerClass({
 
         let resetDialog = () => {
             if (this.state != ModalDialog.State.OPENED)
-                return;
+                return GLib.SOURCE_REMOVE;
 
             this._passwordEntry.hide();
             this._cancelButton.grab_key_focus();
             this._okButton.reactive = false;
+
+            return GLib.SOURCE_REMOVE;
         };
 
         if (delay) {